mergeInto(LibraryManager.library, {
  //url =const char* bufsize=i32 bufptr= ptr callback =calback
  wasmbox_load_text_utf16_async: function (url,callback,userdata) {
    var strurl = UTF8ToString(url);
    fetch(strurl).then(response => response.text()).then(function (txt) {
      
      var mem=_malloc(txt.length*2+2);
      for(var i=0;i<txt.length;i++)
      {
          HEAP16[(mem>>1)+i] = txt.charCodeAt(i);
      }
      HEAP16[(mem>>1)+txt.length] = 0;
      getWasmTableEntry(callback)(txt.length,mem,userdata);
    });
  }
});
